home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 298_01 / unix.h < prev   
C/C++ Source or Header  |  1987-05-21  |  2KB  |  58 lines

  1. /* PC Curses. (C) Copyright 1987 Jeffrey S. Dean.  All Rights Reserved. */
  2.  
  3. /* unix.h - definitions for running PC Curses on Unix
  4.  *
  5.  *    PC Curses was designed to be compatible with Unix curses.
  6.  *    However, there are a few upward-compatible changes or
  7.  *    extensions in PC Curses.  When porting a PC Curses program
  8.  *    to Unix, copy this include file over, and include it in
  9.  *    the program.
  10.  */
  11. #ifdef unix
  12.  
  13. #define CHTYPE short
  14.  
  15. /* approximation of line drawing characters */
  16. #define S_HOR '-'
  17. #define S_VERT '|'
  18. #define D_HOR '='
  19. #define D_VERT '"'
  20.  
  21. /* no screen attributes */
  22. #define A_NONE        0
  23.  
  24. /* standard function definitions */
  25. WINDOW *newwin();
  26. WINDOW *shadowwin();
  27.  
  28. /* PC Curses only: terminfo cinch() == termcap inch() */
  29. #define wcinch(win)        (A_ATTRIBUTES & winch(win)) 
  30. #define cinch()            wcinch(stdscr)
  31. #define    mvwcinch(win,y,x)    (wmove(win,y,x)==ERR?ERR:wcinch(win))
  32. #define    mvcinch(y,x)        mvwcinch(stdscr,y,x)
  33.  
  34. /* The curses package is lacking in a method for accessing window
  35.  *  information, aside from directly accessing the window struct
  36.  *  (a bad idea, and a violation of the abstraction).  These macros
  37.  *  are one answer to that problem.
  38.  */
  39. #define BEGY(w)        w->_begy    /* starting position of window */
  40. #define BEGX(w)        w->_begx
  41. #define CURY(w)        w->_cury    /* current position in window */
  42. #define CURX(w)        w->_curx
  43. #define MAXY(w)     w->_maxy    /* number of lines */
  44. #define MAXX(w)        w->_maxx    /* number of columns */
  45. #define WGETC(w,y,x)    w->_y[y][x]    /* get character from window */
  46. #define WPUTC(w,y,x,c)    w->_y[y][x]=c    /* place character in window */
  47.  
  48. #define KEY_END KEY_LL
  49.  
  50. /* unnecessary functions */
  51. #define pc_uptype(scr)
  52.  
  53. /* unnecessary defines */
  54. #define T_BIOS        0
  55. #define T_DIRECT    0
  56.  
  57. #endif /* unix */
  58.